<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
<meta content="Fenozix,idv.cjcat.physics.fenozix.Fenozix,damping,gravity,iterations,stepInterval,wind,add,clear,clearConstraints,createSpring,remove,removeConstraint,step" name="keywords">
<title>idv.cjcat.physics.fenozix.Fenozix</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'Fenozix - API Documentation';
				var baseRef = '../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">CJLibrary</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../index.html?idv/cjcat/physics/fenozix/Fenozix.html&amp;idv/cjcat/physics/fenozix/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;Fenozix</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class Fenozix"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">idv.cjcat.physics.fenozix</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class Fenozix</td>
</tr>
</table>
<p></p>
   <p></p>
<br>
<span class="label">Example</span>
<br>   <div class='listing'><pre>
   //This examples creates a spring chain with its head following the mouse cursor.
      import idv.cjcat.display.LineStyle;
   import idv.cjcat.display.dynashape.DynaGraphics;
   import idv.cjcat.display.dynashape.DynaShape;
   import idv.cjcat.display.shapes.Circle;
   import idv.cjcat.physics.fenozix.Fenozix;
      var circles:Array = new Array();
   var i:int;
   for (i = 0; i &lt; 5; i++) {
    var c:Circle = new Circle(10);
    c.y = 20 &#42; i;
    circles.push(c);
    addChild(c);
   }
      //Creates the simulation environment
   var engine:Fenozix = new Fenozix();
   engine.gravity.y = 0.5;
   engine.add(circles[0], 0); //static object
   for (i = 1; i &lt; circles.length; i++) engine.add(circles[i]);
   for (i = 0; i &lt; circles.length - 1; i++) engine.createSpring(circles[i], circles[i + 1]);
   
   //Creates a DynaShape for spring constarints visualization
   var ds:DynaShape = new DynaShape();
   var dg:DynaGraphics = new DynaGraphics();
   dg.lineStyle(new LineStyle());
   dg.moveTo(circles[0]);
   for (i = 1; i &lt; circles.length; i++) dg.lineTo(circles[i]);
   ds.add(dg);
   addChildAt(ds, 0);
      //The main loop
   addEventListener(Event.ENTER_FRAME, loop);
   function loop(e:Event):void {
    circles[0].x = mouseX;
    circles[0].y = mouseY;
    engine.step();
    ds.render();
   }</pre></div>
   <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#damping">damping</a> : Number<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">Fenozix</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#gravity">gravity</a> : <a href="../../geom/Vector2.html">Vector2</a>
<div class="summaryTableDescription">[read-only]
   The gravity vector.</div>
</td><td class="summaryTableOwnerCol">Fenozix</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#iterations">iterations</a> : uint<div class="summaryTableDescription">
   Iterations of each simulation step.</div>
</td><td class="summaryTableOwnerCol">Fenozix</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#stepInterval">stepInterval</a> : Number<div class="summaryTableDescription">
   How much time a single call to step() elapses.</div>
</td><td class="summaryTableOwnerCol">Fenozix</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#wind">wind</a> : <a href="../../geom/Vector2.html">Vector2</a>
<div class="summaryTableDescription">[read-only]
   The wind vector.</div>
</td><td class="summaryTableOwnerCol">Fenozix</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#Fenozix()">Fenozix</a>(damping:Number = 0.03, stepInterval:Number = 1)</div>
<div class="summaryTableDescription">
   Creates a Fenozix engine.</div>
</td><td class="summaryTableOwnerCol">Fenozix</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#add()">add</a>(obj:Object, mass:Number = 1, initVX:Number = 0, initVY:Number = 0):void</div>
<div class="summaryTableDescription">
   Adds an object to simulation.</div>
</td><td class="summaryTableOwnerCol">Fenozix</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#clear()">clear</a>():void</div>
<div class="summaryTableDescription">
   Removes all objects from simulation.</div>
</td><td class="summaryTableOwnerCol">Fenozix</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#clearConstraints()">clearConstraints</a>():void</div>
<div class="summaryTableDescription">
   Removes all constraints.</div>
</td><td class="summaryTableOwnerCol">Fenozix</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#createSpring()">createSpring</a>(obj1:Object, obj2:Object, stiffness:Number = 0.05, length:Number):<a href="../fenozix/Spring.html">Spring</a>
</div>
<div class="summaryTableDescription">
   Create a spring constraint between two objects.</div>
</td><td class="summaryTableOwnerCol">Fenozix</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#remove()">remove</a>(obj:Object):void</div>
<div class="summaryTableDescription">
   Removes an object from simulation.</div>
</td><td class="summaryTableOwnerCol">Fenozix</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeConstraint()">removeConstraint</a>(constraint:AbstractConstraint):void</div>
<div class="summaryTableDescription">
   Remove a constraint from simulation.</div>
</td><td class="summaryTableOwnerCol">Fenozix</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#step()">step</a>(e:Event = null):void</div>
<div class="summaryTableDescription">
   Call this method repeatedly to keep the simulation running.</div>
</td><td class="summaryTableOwnerCol">Fenozix</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="damping"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">damping</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>public var damping:Number</code>
</div>
<a name="gravity"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">gravity</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>gravity:<a href="../../geom/Vector2.html">Vector2</a></code>&nbsp;&nbsp;[read-only]<p>
   The gravity vector.
   Applies equal acceleration to all objects.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get gravity():<a href="../../geom/Vector2.html">Vector2</a></code>
<br>
</div>
<a name="iterations"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">iterations</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>iterations:uint</code>&nbsp;&nbsp;[read-write]<p>
   Iterations of each simulation step.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get iterations():uint</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set iterations(value:uint):void</code>
<br>
</div>
<a name="stepInterval"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">stepInterval</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>stepInterval:Number</code>&nbsp;&nbsp;[read-write]<p>
   How much time a single call to step() elapses.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get stepInterval():Number</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set stepInterval(value:Number):void</code>
<br>
</div>
<a name="wind"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">wind</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>wind:<a href="../../geom/Vector2.html">Vector2</a></code>&nbsp;&nbsp;[read-only]<p>
   The wind vector.
   Applies equal force to all objects.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get wind():<a href="../../geom/Vector2.html">Vector2</a></code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="Fenozix()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">Fenozix</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function Fenozix(damping:Number = 0.03, stepInterval:Number = 1)</code><p>
   Creates a Fenozix engine.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">damping</span>:Number</code> (default = <code>0.03</code>)<code></code> &mdash;       The damping coefficient of the engine.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">stepInterval</span>:Number</code> (default = <code>1</code>)<code></code> &mdash;  The time step interval used for each step() call.
   </td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="add()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">add</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function add(obj:Object, mass:Number = 1, initVX:Number = 0, initVY:Number = 0):void</code><p>
   Adds an object to simulation.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">obj</span>:Object</code> &mdash;     The object.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">mass</span>:Number</code> (default = <code>1</code>)<code></code> &mdash;    The mass of the object. Setting mass to zero makes the object static; that is, the object will not be moved by forces.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">initVX</span>:Number</code> (default = <code>0</code>)<code></code> &mdash;  The initial X component of the object's velocity.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">initVY</span>:Number</code> (default = <code>0</code>)<code></code> &mdash;  The initial Y component of the object's velocity.
   </td>
</tr>
</table>
</div>
<a name="clear()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">clear</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function clear():void</code><p>
   Removes all objects from simulation.
   </p></div>
<a name="clearConstraints()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">clearConstraints</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function clearConstraints():void</code><p>
   Removes all constraints.
   </p></div>
<a name="createSpring()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">createSpring</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function createSpring(obj1:Object, obj2:Object, stiffness:Number = 0.05, length:Number):<a href="../fenozix/Spring.html">Spring</a></code><p>
   Create a spring constraint between two objects.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">obj1</span>:Object</code> &mdash;          The first object.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">obj2</span>:Object</code> &mdash;          The second object.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">stiffness</span>:Number</code> (default = <code>0.05</code>)<code></code> &mdash;     The stiffness of the spring. This value should lie between 0 and 1.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">length</span>:Number</code> &mdash;        The length of the spring. By default, this value is set to the distance between the two objects.
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../fenozix/Spring.html">Spring</a></code> &mdash; 
                                       A reference to the spring constraint created. This reference can be passed to the <code>removeConstraint()</code> method to remove the constraint.
   
                        
                     </td>
</tr>
</table>
</div>
<a name="remove()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">remove</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function remove(obj:Object):void</code><p>
   Removes an object from simulation.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">obj</span>:Object</code> &mdash;  The object.
   </td>
</tr>
</table>
</div>
<a name="removeConstraint()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeConstraint</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function removeConstraint(constraint:AbstractConstraint):void</code><p>
   Remove a constraint from simulation.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">constraint</span>:AbstractConstraint</code> &mdash;  The constraint.
   </td>
</tr>
</table>
</div>
<a name="step()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">step</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function step(e:Event = null):void</code><p>
   Call this method repeatedly to keep the simulation running.
   </p><p>This method can be used as an event listener.</p>
   <span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">e</span>:Event</code> (default = <code>null</code>)<code></code></td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
